package framework;

/**
 * Interface of Person to interact with Game.
 *
 * @author Denis DIR Rozhnev
 */
public interface Person {
    void init(PersonContext ctx);

    /**
     * @return the most 4-character name, often abbreviation. A first letter must be unique,
     *         its used for visualization.
     */
    String getShortName();

    /** @return the algorithm name. */
    String getName();

    /** @return the algorithm description. */
    String getDescription();

    /**
     * @param id the Person to deal with.
     * @return the lower value is more "defect", the higher - is more "cooperate", 0 - is neutral.
     *         Concrete values depends on {@link Business} implementation.
     */
    int deal(Object id);

    void dealed(Object id, int deal);

    /**
     * Called when person receives a message from another person.
     *
     * @param id      of sender
     * @param message
     * @return the answer
     */
    Object messageReceived(Object id, Object message);
}
